package neuroPoker.training;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintStream;

public class Util {
	public static PrintStream ps;

	public static boolean isSuspended = false;

	public synchronized static void suspendOutput() {
		if (isSuspended)
			return;
		ps = System.out;
		try {
			System.setOut(new PrintStream(new File("Out.txt")));
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
		isSuspended = true;
	}

	public synchronized static void restoreOutput() {
		if (!isSuspended)
			return;
		System.setOut(ps);
		isSuspended = false;
	}
}
